<style lang="css" src="./buytype-list.css"></style>

<template lang="html">
  <div class="buytype-list ly-row-flex">
    <a class="btn btn-sm btn-primary btn-link-return" v-link="{ path: '/' }">返回组合列表</a>
    <add-buy-type></add-buy-type>
    <table class="table table-bordered table-hover">
      <caption>港股套餐列表</caption>
      <thead>
        <tr>
          <th class="col-xs-1">id</th>
          <th class="col-xs-2">套餐名称</th>
          <th class="col-xs-1">天数</th>
          <th class="col-xs-2">原始价格</th>
          <th class="col-xs-2">折后价格</th>
          <th class="col-xs-2">货币类型</th>
          <th class="col-xs-2"></th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="buytype in buytypeList">
          <td class="col-sm-1">{{buytype.id}}</td>
          <td class="col-sm-2">{{buytype.title}}</td>
          <td class="col-sm-1">{{buytype.days}}</td>
          <td class="col-sm-2">{{buytype.price}}</td>
          <td class="col-sm-2">{{buytype.actualPrice}}</td>
          <td class="col-sm-2">{{buytype.amountType | getAmountType}}</td>
          <td class="col-sm-2">
            <update-buy-type :buytype="deepClone(buytype)"></update-buy-type>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script src="./buytype-list.js"></script>
